From 03ed1e1311160576ca0a93f25fb6d15f4ee235c2 Mon Sep 17 00:00:00 2001 From: Alokzh Date: Fri, 20 Jun 2025 08:54:41 +0530 Subject: [PATCH 1/2] Removed example for file processing in chunks from README.md --- README.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/README.md b/README.md index c9f3517..6b84056 100644 --- a/README.md +++ b/README.md @@ -61,22 +61,6 @@ chat push: 'User3: Good morning!'. "Oldest message automatically removed" "Always has recent 50 messages, zero manual cleanup" ``` -### File Processing in Chunks -This example shows how to process large files in manageable chunks without loading the entire file into memory, using a FIFO buffer to handle data efficiently. - -```smalltalk -"Process massive files without loading everything into memory" -fileBuffer := CTFIFOBuffer withCapacity: 1024. "1KB processing chunks" -stream := 'huge-dataset.csv' asFileReference readStream. -[ stream atEnd ] whileFalse: [ - chunk := stream next: 1024. - fileBuffer push: chunk. - self processDataChunk: fileBuffer pop "Process and auto-remove" -]. - -"Memory usage stays constant - handles files of any size!" -``` - ## LIFO Buffer Use Cases ### Undo/Redo Functionality From 4f7625fba4623f6b6b71479b9c09fce1b3205849 Mon Sep 17 00:00:00 2001 From: Alokzh Date: Sun, 22 Jun 2025 15:22:04 +0530 Subject: [PATCH 2/2] Update performance comparison in README.md --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6b84056..04715a0 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ previousPage := browserHistory pop. "Gets 'https://pharo.org' (third most recen ``` -### Performance Degradation +### Performance Comparison ```smalltalk "OrderedCollection - Gets slower and slower" log := OrderedCollection new. @@ -109,15 +109,12 @@ log := OrderedCollection new. log removeFirst "O(n) operation - shifts 999+ elements EVERY TIME!" ]. ]. -"Performance degrades from 1ms to 100ms+ per operation" -"Buffer - Lightning fast forever" +"Buffer - Fast and automatic" log := CTFIFOBuffer withCapacity: 1000. 1 to: 100000 do: [ :i | - log push: 'entry ', i asString. "O(1) operation - always instant!" + log push: 'entry ', i asString. "O(1) operation - Automatic Management !" ]. - -"Consistent 0.01ms performance whether it's operation #10 or #10,000,000" ``` ### Comparison | Operation | OrderedCollection | Array | CTFIFOBuffer |