Search found 16 matches

by UncleBen
Fri Jul 08, 2016 1:59 pm
Forum: General Discussion
Topic: Test and compare purebasic internal function and library
Replies: 6
Views: 3117

Re: Test and compare purebasic internal function and library

If we don't know how many slot to use

then by default (slot 512)
test on 200k elements


Purebasic Map() vs List() vs Array() performance test and comparison
Test on 200000 element size

Sequential fill element with constant value test :
=== Test === Result ===( Sequential fill With 200000 ...
by UncleBen
Fri Jul 08, 2016 1:31 pm
Forum: General Discussion
Topic: Test and compare purebasic internal function and library
Replies: 6
Views: 3117

Re: Test and compare purebasic internal function and library

This is not a representative test of all use cases, it's just a presentation of some cases...

The true strength of a list is the fast adding and removing of elements when the maximum number of elements is unknown (in the beginning) or varies greatly. In this cases you would use a ReDim() on the ...
by UncleBen
Fri Jul 08, 2016 1:19 pm
Forum: General Discussion
Topic: Test and compare purebasic internal function and library
Replies: 6
Views: 3117

Re: Test and compare purebasic internal function and library

Maps are actually a lot faster than your test shows. You are creating a map in its simplest form without specifying a bucket count. The default bucket count of a map created in this way is 512, which is far too small for 10k elements. You will have many many collisions, which result in the map ...
by UncleBen
Thu Jul 07, 2016 5:59 am
Forum: General Discussion
Topic: Test and compare purebasic internal function and library
Replies: 6
Views: 3117

Test and compare purebasic internal function and library

If you code a game or graphic , or some business applications , you will consider the speed and performance of the codes .
so to say , how you choose to use which data manipulation function , array or list or map ?

for gamer you may think array is the best for speed ,
but have you ever think about ...
by UncleBen
Wed Jul 06, 2016 3:24 am
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Re: Experiments of Doubly Linked List update REVISION 2

Nice experiments. I never write so much tests for any of my stuff (well, I'm never writing special tests at all ^^)

There are several code-improvement tips to make life harder :)
- do not use any Goto/Gosub jumps
- always turn EnableExplicit for anything which is larger than "helloworld" program ...
by UncleBen
Tue Jul 05, 2016 5:20 pm
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Re: Experiments of Custom Linked List

Doubly Linked List
Experiment REVISION 2

TITLE:
Educational Experiments of Doubly Linked List with "Head" segment and including 18 Test Routines Lesson EP1.RV.2
Full documented and well commented code

My own linked List experiments
Written by : Uncle Ben (A.K.A William)

Experiment 1 ...
by UncleBen
Fri Jul 01, 2016 12:48 pm
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Re: Experiments of Custom Linked List

It's always good to learn more about data structures and other basic concepts, keep going! :)

However, keep in mind that linked lists are almost never a good idea if you are looking for performance
and generally it is better to just using array buffers and resize them dynamically as copying is ...
by UncleBen
Fri Jul 01, 2016 3:47 am
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Re: Experiments of Custom Linked List

In programing ,an array of DATA is highly tie together with a wall in front and at the back , so it look like this :

||[DATA][DATA][DATA][DATA][DATA]||
when create an array , the front and back wall was created first before the [DATA] can be store, and only fixed amount of data were allowed after ...
by UncleBen
Fri Jul 01, 2016 1:51 am
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Re: Experiments of Custom Linked List

A good article to explain the basic theory of linked list , A.K.A. chain , node ...
https://www.cs.cmu.edu/~adamchik/15-121 ... lists.html
by UncleBen
Thu Jun 30, 2016 4:20 pm
Forum: General Discussion
Topic: Experiments of Doubly Linked List update REVISION 2
Replies: 7
Views: 3687

Experiments of Doubly Linked List update REVISION 2

Although i am age, but hunger to learn ,so i took my self a lesson in free time to do a Experiment to understand more in coding

feel free to test the code or use it if needed.

Any comment welcome ...
by UncleBen
Mon Jan 19, 2015 2:00 pm
Forum: Coding Questions
Topic: [Macro] Not sure is this a bug or feature
Replies: 11
Views: 4407

Re: [Macro] Not sure is this a bug or feature

Do you like that ? :shock:

Even using REM like a function with text as its param ? Looks pretty ugly yo me.

It's not exactly replacing ";" with "REM"

Or multiple lines which would go inside an IF/ENDIF block now on a single line separated by commas ?

I thought you were not looking for ...
by UncleBen
Mon Jan 19, 2015 12:04 pm
Forum: Coding Questions
Topic: [Macro] Not sure is this a bug or feature
Replies: 11
Views: 4407

Re: [Macro] Not sure is this a bug or feature

PB Style:
Macro Then(_stmt1_=,_stmt2_=,_stmt3_=,_stmt4_=,_stmt5_=,_stmt6_=,_stmt7_=,_stmt8_=,_stmt9_=,_stmt10_=)
: _stmt1_ : _stmt2_ : _stmt3_ : _stmt4_ : _stmt5_ : _stmt6_ : _stmt7_ : _stmt8_ : _stmt9_ : _stmt10_ : EndIf
EndMacro

Macro Do(_stmt1_=,_stmt2_=,_stmt3_=,_stmt4_=,_stmt5_=,_stmt6 ...
by UncleBen
Mon Jan 19, 2015 2:36 am
Forum: Coding Questions
Topic: [Macro] Not sure is this a bug or feature
Replies: 11
Views: 4407

Re: [Macro] Not sure is this a bug or feature

From [PB5.30]Documentation of MACRO
Macros


Syntax
Macro <name> [(Parameter [, ...])]
...
EndMacro

Description

Macros are a very powerful feature, mainly useful for advanced programmers. A macro is a placeholder for some code (one keyword, one line or even many lines), which will be directly ...
by UncleBen
Sun Jan 18, 2015 1:35 pm
Forum: Coding Questions
Topic: [Macro] Not sure is this a bug or feature
Replies: 11
Views: 4407

Re: [Macro] Not sure is this a bug or feature

You posted this in the "Bugs - Documentation" subforum.
So what exactly is the bug in the documentation that you want to report?


I'm not sure , that's why i ask,
[Macro] Not sure is this a bug or feature

for the MACRO , i suppose understand :

Macro something_to_be_replace
something_actual ...
by UncleBen
Sun Jan 18, 2015 12:21 pm
Forum: Coding Questions
Topic: [Macro] Not sure is this a bug or feature
Replies: 11
Views: 4407

Re: [Macro] Not sure is this a bug or feature


A macro can't have the same name as a keyword: EndIf.

I don't know where this is officially documented, but I think macro names (like any other identifiers in PB) can only contain digits 0-9 (not at the beginning), characters A-Z, a-z, and "_".

There was so much fun if the macro can replace ...